<template>
  <div id="order">
    <div class="order-top">
      <div class="form-group">
        <span class="spanRed">*</span>供应商：
        <el-input style="width: 150px" v-model="proName"></el-input>
        <el-button @click="dialogShow = true">...</el-button>
      </div>

      <div class="form-group">
        业务员：
        <el-select
          v-model="purchaseInquiry.yid"
          placeholder="业务员"
          style="margin-left: 10px; width: 100px"
        >
          <el-option label="(空)" :value="0"> </el-option>
          <el-option
            v-for="item in employee"
            :key="item.employeeId"
            :label="item.employeeName"
            :value="item.employeeId"
          >
          </el-option>
        </el-select>
      </div>

      <div class="form-group">
        交货方式:
        <el-select
          v-model="purchaseInquiry.deliveryMethodId"
          placeholder="交货方式"
          style="margin-left: 10px; width: 110px"
        >
          <el-option label="(空)" :value="0"> </el-option>
          <el-option label="快递物流" :value="1"> </el-option>
          <el-option label="自配送" :value="2"> </el-option>
          <el-option label="自提" :value="3"> </el-option>
          <el-option label="其他" :value="4"> </el-option>
        </el-select>
      </div>

      <div class="form-group">
        <span class="demonstration">单据日期:</span>
        <el-date-picker
          v-model="purchaseInquiry.createDate"
          align="right"
          type="date"
          placeholder="选择日期"
          style="margin-left: 10px"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
        >
        </el-date-picker>
      </div>
      <div class="form-group">
        <span class="demonstration">询价报价有效期:</span>
        <el-date-picker
          type="daterange"
          v-model="effectiveDateRange"
          align="right"
          unlink-panels
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          @change="handleDateChange"
        >
        </el-date-picker>
      </div>
      <div class="form-group">
        <i class="el-icon-paperclip" style="color: blue"></i>
        <span style="color: blue">上传附件</span>
        <span style="margin-left: 10px">单据编号:</span>
        <el-input
          style="width: 120px; margin-left: 10px; margin-right: 20px"
          placeholder=""
          v-model="purchaseInquiry.documentNumber"
          clearable
        >
        </el-input>
        <el-dropdown>
          <span class="el-dropdown-link">
            <i class="el-icon-edit"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>XJ</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>

    <el-divider></el-divider>
    <div style="float: right; margin-bottom: 10px">
      <el-button type="primary" @click="save()"
        >保存{{ this.purchaseInquiry.id ? "修改" : "新增" }}</el-button
      >
      <el-button type="primary">导入</el-button>
    </div>

    <div class="order-content">
      <el-table
        :row-style="{ height: '55px' }"
        show-summary
        :summary-method="getSummaries"
        height="330px"
        :data="inquirylist"
        border
        style="width: 100%; font-size: 13px"
      >
        <!-- <el-table-column label="选中" width="50">
          <template slot-scope="scope">
            <el-radio v-model="selectedRow" :label="scope.row.id">{{
              a
            }}</el-radio>
          </template>
        </el-table-column> -->

        <el-table-column style="width: 120px; padding-left: 10px">
          <template slot-scope="scope">
            <el-button
              size="mini"
              style="margin-left: 10px"
              @click="addRow(scope.$index)"
              ><i class="el-icon-circle-plus-outline"></i
            ></el-button>
            <el-button size="mini" @click="reduceRow(scope.$index)"
              ><i class="el-icon-remove-outline"></i
            ></el-button>
          </template>
        </el-table-column>

        <!-- 商品开始 -->
        <el-table-column prop="goodcode" label="商品编号" width="300">
          <template slot="header" slot-scope="{ column }">
            <span class="spanRed">*</span> {{ column.label }}
          </template>
          <template slot-scope="scope">
            <el-input
              style="width: 200px"
              placeholder="商品"
              v-model="scope.row.goodcode"
            ></el-input
            ><el-button @click="goods(scope.$index)">选择</el-button>
          </template>
        </el-table-column>

        <el-table-column prop="goodname" label="商品名称" width="150">
          <template slot-scope="scope">
            <el-input size="small" v-model="scope.row.goodname"></el-input>
          </template>
        </el-table-column>

        <el-table-column prop="imagename" label="商品图片" width="120">
        </el-table-column>
        <el-table-column prop="categoryName" label="商品类别" width="120">
        </el-table-column>
        <el-table-column prop="brandName" label="品牌" width="120">
        </el-table-column>
        <el-table-column prop="unitname" label="单位" width="120">
        </el-table-column>

        <!-- 商品结束 -->

        <!-- 仓库 -->
        <el-table-column prop="" label="仓库" width="320">
          <template slot="header" slot-scope="{ column }">
            <span class="spanRed">*</span> {{ column.label }}
          </template>
          <template slot-scope="scope">
            <!-- <el-button
              slot="append"
              icon="el-icon-search"
              @click="dialogVisible3 = true"
            ></el-button> -->

            <el-select v-model="scope.row.wId" placeholder="请选择">
              <el-option
                v-for="item in storeHouse"
                :key="item.shId"
                :label="item.storeHomeCode + ' ' + item.storeHomeName"
                :value="item.shId"
              >
              </el-option>
            </el-select>
          </template>
        </el-table-column>

        <!-- 可用库存 -->
        <el-table-column prop="availableStock" label="可用库存" width="120">
          <template slot-scope="scope">
            {{ scope.row.availableStock }}
          </template>
        </el-table-column>

        <!-- 仓库结束 -->

        <!-- 数量 -->
        <el-table-column label="数量" width="130">
          <template slot="header" slot-scope="{ column }">
            <span class="spanRed">*</span> {{ column.label }}
          </template>
          <template slot-scope="scope">
            <el-input
              style="width: 100px"
              placeholder="数量"
              v-model="scope.row.totalNum"
              @blur="calculateRow(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 整件散包 -->
        <el-table-column prop="packType" label="整件散包" width="120">
        </el-table-column>

        <!-- 基本单位 -->
        <el-table-column prop="unitname" label="基本单位" width="120">
        </el-table-column>

        <!-- 基本数量 -->
        <el-table-column prop="totalNum" label="基本数量" width="120">
          <template slot-scope="scope">
            {{ scope.row.totalNum }}
          </template>
        </el-table-column>

        <!-- 购货单价 -->
        <el-table-column prop="purchasePrice" label="购货单价" width="130">
          <template slot-scope="scope">
            <el-input
              style="width: 100px"
              placeholder="购货单价"
              v-model="scope.row.purchasePrice"
              @blur="calculateRow(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 含税单价 -->
        <el-table-column prop="totalPrice" label="含税单价" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="含税单价"
              v-model="scope.row.totalPrice"
              @blur="calculateRowTotalPrice(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 折扣率 -->
        <el-table-column prop="discount" label="折扣率(%)" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="折扣率"
              v-model="scope.row.discount"
              @blur="calculateRow(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 折扣 -->
        <el-table-column prop="discountNoRate" label="折扣(折)" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="折扣"
              v-model="scope.row.discountNoRate"
              @blur="calculateDiscountNoRate(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 折扣额 -->
        <el-table-column prop="discountAmount" label="折扣额" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="商品"
              v-model="scope.row.discountAmount"
              @blur="calculateRowDiscountAmount(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 金额 -->
        <el-table-column prop="amount" label="金额" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="商品"
              v-model="scope.row.amount"
              @blur="calculateRowAmount(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 税率 -->
        <el-table-column label="税率(%)" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="税率"
              v-model="scope.row.taxRate"
              @blur="calculateRow(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 税额 -->
        <el-table-column prop="tax" label="税额" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="税额"
              v-model="scope.row.tax"
              @blur="calculateRowTax(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 价税合计 -->
        <el-table-column prop="totalMoney" label="价税合计" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="价税合计"
              v-model="scope.row.totalMoney"
              @blur="calculateRowTotalMoney(scope.row)"
            ></el-input>
          </template>
        </el-table-column>

        <!-- 备注 -->
        <el-table-column label="备注" width="120">
          <template slot-scope="scope">
            <el-input
              style="width: 90px"
              placeholder="备注"
              v-model="scope.row.detailRemark"
            ></el-input>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div>
      <el-input
        type="textarea"
        placeholder="备注"
        rows="2"
        v-model="purchaseInquiry.remark"
        style="width: 100%; margin: 10px 0 0 10px"
      >
      </el-input>
    </div>

    <div style="float: right; margin-top: 10px">
      <el-button @click="goto('purInqDoc')">历史单据</el-button>
    </div>

    <el-dialog top="20px" title="选择供应商" :visible.sync="dialogShow">
      <ProviderChoose ref="choosePro" :dialogShow="dialogShow" />
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogShow = false">取 消</el-button>
        <el-button type="primary" @click="yes">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog top="20px" title="选择商品" :visible.sync="goodsShow">
      <GoodsChoose ref="chooseGoods" :goodsShow="goodsShow" />
      <div slot="footer" class="dialog-footer">
        <el-button @click="goodsShow = false">取 消</el-button>
        <el-button type="primary" @click="yesGoods">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 
    <el-dialog title="商品库存查询" :visible.sync="dialogVisible3" width="30%">
      <div class="dialog-footer">
        <el-button type="primary" @click="dialogVisible3 = false"
          >确认</el-button
        >
        <el-button @click="dialogVisible3 = false">关闭</el-button>
      </div>
    </el-dialog> -->
  </div>
</template>

<script>
import ProviderChoose from "../public_com/ProviderChoose.vue";
import GoodsChoose from "../public_com/GoodsChoose.vue";
import { myMixin } from "./other/mixin.js";

export default {
  name: "purchaseInquiry",
  components: {
    ProviderChoose,
    GoodsChoose,
  },
  mixins: [myMixin],
  data() {
    return {
      index: "",
      storeHouse: [],
      effectiveDateRange: "",
      dialogShow: false,
      goodsShow: false,
      // dialogVisible3: false,
      proName: "",
      employee: [],
      purchaseInquiry: {
        id: "",
        proId: "",
        yid: 0,
        deliveryMethodId: 0,
        startDate: "",
        endDate: "",
        documentNumber: "",
        quantity: "",
        amount: "",
        status: "",
        remark: "",
      },
      inquirylist: [
        {
          id: "", // id
          numbering: "", // 询价单id
          unitId: "", // 单位Id
          totalNum: 1, // 数量
          discount: 0, // 折扣率
          detailRemark: "", // 详细备注
          imagename: null, // 商品图片名称
          goodcode: "", // 商品编号
          brandName: "", // 品牌名称
          origin: "", // 产地
          goodname: "", // 商品名称
          categoryName: "", // 商品类别
          unitname: "", // 单位名称
          wId: "", // 仓库Id
          availableStock: "", // 可用库存
          purchasePrice: 0, //购货单价
          totalPrice: 0, // 含税单价
          taxRate: 0, // 税率
          tax: 0, // 税额
          totalMoney: 0, // 价税合计
          discountAmount: 0, // 折扣额
          discountNoRate: 10, // 折扣(折)
          amount: 0, // 金额
        },
      ],
    };
  },
  methods: {
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      let validData = data.filter((item) => item.goodcode); // 过滤出商品编码不为空的行

      let totalNum = 0; // 用于累计数量的合计
      let totalMoney = 0; // 用于累计价税合计的合计

      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
          return;
        }
        // 定义需要合计的列属性
        const needSumProperties = [
          "totalNum",
          "discountAmount",
          "amount",
          "tax",
          "totalMoney",
        ];
        if (needSumProperties.includes(column.property)) {
          const values = validData.map((item) => Number(item[column.property]));
          const sum = values.reduce((prev, curr) => {
            const value = Number(curr);
            return !isNaN(value) ? prev + value : prev;
          }, 0);
          if (column.property === "totalNum") {
            // 数量列，不保留小数点
            totalNum = sum; // 累计数量合计
            sums[index] = sum;
          } else if (column.property === "totalMoney") {
            // 价税合计列，保留两位小数
            totalMoney = sum; // 累计价税合计
            sums[index] = sum.toFixed(2);
          } else {
            // 其他金额列，保留两位小数
            sums[index] = sum.toFixed(2);
          }
        } else {
          sums[index] = "";
        }
      });

      // 将合计的数量和价税合计赋值给purchaseInquiry对象
      this.purchaseInquiry.quantity = totalNum.toFixed(0);
      this.purchaseInquiry.amount = totalMoney.toFixed(2);

      return sums;
    },
    save() {
      //数据校验

      // 校验供应商
      if (!this.purchaseInquiry.proId) {
        this.errorMessage("供应商不能为空");
        return;
      }

      // 校验单据日期
      if (!this.purchaseInquiry.createDate) {
        this.errorMessage("单据日期不能为空");
        return;
      }

      // 校验开始日期和结束日期
      if (!this.purchaseInquiry.startDate || !this.purchaseInquiry.endDate) {
        this.errorMessage("询价报价有效期开始日期和结束日期不能为空");
        return;
      }

      var msgWId = "";

      console.log(this.purchaseInquiry);
      //获取入库单明细
      var details = [];

      this.inquirylist.forEach((inquiry, index) => {
        if (inquiry.goodcode && inquiry.goodname) {
          // 只有当商品编码不为空时，才添加到details

          if (!inquiry.wId) {
            msgWId = "商品" + inquiry.goodcode + "仓库不可以为空";
            return;
          }

          details.push({
            unitId: inquiry.unitId, //
            totalNum: inquiry.totalNum, //
            totalMoney: inquiry.totalMoney, //
            discount: inquiry.discount, //
            detailRemark: inquiry.detailRemark, //
            goodcode: inquiry.goodcode, //
            goodname: inquiry.goodname, //
            unitname: inquiry.unitname, //
            wId: inquiry.wId, //
            totalPrice: inquiry.totalPrice, //
            tax: inquiry.tax, //
          });
        }
      });

      if (msgWId) {
        this.errorMessage(msgWId);
        return;
      }

      if (details.length < 1) {
        this.errorMessage("商品信息不可以为空");
        return;
      }

      // console.log(details)
      const formdata = new FormData();
      formdata.append("purchaseInquiry", JSON.stringify(this.purchaseInquiry));
      formdata.append("inquirylist", JSON.stringify(details));

      if (!this.purchaseInquiry.id) {
        this.axios
          .post("/purchase/purchaseInquiry/add", formdata)
          .then((rs) => {
            if ((rs.data.code = 200)) {
              this.successMessage("添加成功");
              this.letNull();
            } else {
              this.errorMessage("添加失败");
            }
          });
      } else {
        this.axios.post("/purchase/purchaseInquiry/up", formdata).then((rs) => {
          if ((rs.data.code = 200)) {
            this.successMessage("修改成功");
            this.letNull();
          } else {
            this.errorMessage("修改失败");
          }
        });
      }
    },
    letNull() {
      this.effectiveDateRange = "";
      this.proName = "";
      this.purchaseInquiry = {
        id: "",
        proId: "",
        yid: 0,
        deliveryMethodId: 0,
        startDate: "",
        endDate: "",
        documentNumber: "",
        quantity: "",
        amount: "",
        status: "",
        remark: "",
      };
      this.inquirylist = [
        {
          id: "", // id
          numbering: "", // 询价单id
          unitId: "", // 单位Id
          totalNum: 1, // 数量
          discount: 0, // 折扣率
          detailRemark: "", // 详细备注
          imagename: null, // 商品图片名称
          goodcode: "", // 商品编号
          brandName: "", // 品牌名称
          origin: "", // 产地
          goodname: "", // 商品名称
          categoryName: "", // 商品类别
          unitname: "", // 单位名称
          wId: "", // 仓库Id
          availableStock: "", // 可用库存
          purchasePrice: 0, //购货单价
          totalPrice: 0, // 含税单价
          taxRate: 0, // 税率
          tax: 0, // 税额
          totalMoney: 0, // 价税合计
          discountAmount: 0, // 折扣额
          discountNoRate: 10, // 折扣(折)
          amount: 0, // 金额
        },
      ];
    },
    handleDateChange(value) {
      if (value) {
        this.purchaseInquiry.startDate = value[0]; // 起始日期
        this.purchaseInquiry.endDate = value[1]; // 结束日期
      }
    },
    goods(index) {
      this.index = index;
      this.goodsShow = true;
    },
    yes() {
      this.dialogShow = false;
      var list = this.$refs.choosePro.selectionList;
      this.proName = list[0].providerName;
      this.purchaseInquiry.proId = list[0].providerId;
    },
    yesGoods() {
      this.goodsShow = false;
      var selectedGoods = this.$refs.chooseGoods.selectionList;
      console.log(selectedGoods);
      if (selectedGoods.length > 0 && this.index !== "") {
        var currentIndex = parseInt(this.index);
        // 插入第一条数据到指定的currentIndex行
        Object.keys(selectedGoods[0]).forEach((key) => {
          this.$set(this.inquirylist[currentIndex], key, selectedGoods[0][key]);
        });

        // 处理剩余的数据
        for (let i = 1; i < selectedGoods.length; i++) {
          // 在当前行后新增一行
          this.addRow(currentIndex + i - 1);

          // 插入数据到新增的行
          Object.keys(selectedGoods[i]).forEach((key) => {
            this.$set(
              this.inquirylist[currentIndex + i],
              key,
              selectedGoods[i][key]
            );
          });
        }
      }
    },
    addRow(index) {
      const newRow = {
        id: "", // id
        numbering: "", // 询价单id
        unitId: "", // 单位Id
        totalNum: 1, // 数量
        discount: 0, // 折扣率
        detailRemark: "", // 详细备注
        imagename: null, // 商品图片名称
        goodcode: "", // 商品编号
        brandName: "", // 品牌名称
        origin: "", // 产地
        goodname: "", // 商品名称
        categoryName: "", // 商品类别
        unitname: "", // 单位名称
        wId: "", // 仓库Id
        availableStock: "", // 可用库存
        purchasePrice: 0, //购货单价
        totalPrice: 0, // 含税单价
        taxRate: 0, // 税率
        tax: 0, // 税额
        totalMoney: 0, // 价税合计
        discountAmount: 0, // 折扣额
        discountNoRate: 10, // 折扣(折)
        amount: 0, // 金额
      };

      this.inquirylist.splice(index + 1, 0, newRow);
    },
    reduceRow(index) {
      if (this.inquirylist.length > 1) {
        this.inquirylist.splice(index, 1);
      }
    },
    selectEm() {
      this.axios({
        url: "/info/employee/listAll",
      }).then((rs) => {
        this.employee = rs.data.list;
      });
    },
    selctSH() {
      // this.axios({
      //   url: "/info/storeHouse/selectAll",
      // }).then((rs) => {
      //   this.storeHouse = rs.data.list;
      // });
      this.axios
        .get("/info/storeHouse/getAllStore", {
          params: {
            cId: 1,
          },
        })
        .then((rs) => {
          this.storeHouse = rs.data.storeList;
        });
    },
    selectById: function () {
      this.axios({
        url: "/purchase/purchaseInquiry/selectById",
        params: {
          id: this.purchaseInquiry.id,
        },
      }).then((rs) => {
        console.log(rs);

        // 赋值操作
        this.proName = rs.data.purchaseInquiry.proName; // 供应商名称
        this.purchaseInquiry.id = rs.data.purchaseInquiry.id; // ID
        this.purchaseInquiry.wid = rs.data.purchaseInquiry.wid; // 仓库id
        this.purchaseInquiry.proId = rs.data.purchaseInquiry.proId; // 供应商ID
        this.purchaseInquiry.yid = rs.data.purchaseInquiry.yid; // 业务员ID
        this.purchaseInquiry.deliveryMethodId =
          rs.data.purchaseInquiry.deliveryMethodId; // 交货方式ID
        this.purchaseInquiry.startDate = rs.data.purchaseInquiry.startDate; // 开始日期
        this.purchaseInquiry.endDate = rs.data.purchaseInquiry.endDate; // 结束日期
        this.purchaseInquiry.createDate = rs.data.purchaseInquiry.createDate; // 结束日期
        this.purchaseInquiry.documentNumber =
          rs.data.purchaseInquiry.documentNumber; // 单据编号
        this.purchaseInquiry.quantity = rs.data.purchaseInquiry.quantity; // 数量
        this.purchaseInquiry.amount = rs.data.purchaseInquiry.amount; // 金额
        this.purchaseInquiry.status = rs.data.purchaseInquiry.status; // 状态
        this.purchaseInquiry.remark = rs.data.purchaseInquiry.remark; // 备注

        this.effectiveDateRange = [
          rs.data.purchaseInquiry.startDate,
          rs.data.purchaseInquiry.endDate,
        ];

        // 询价详情列表
        this.inquirylist = rs.data.purchaseInquiry.inquiryDetails.map(
          (detail) => {
            return {
              id: detail.id,
              numbering: detail.numbering,
              unitId: detail.unitId,
              totalNum: detail.totalNum,
              discount: detail.discount,
              detailRemark: detail.detailRemark,
              imagename: detail.imagename,
              goodcode: detail.goodcode,
              brandName: detail.brandName,
              origin: "",
              goodname: detail.goodname,
              categoryName: detail.categoryName,
              unitname: detail.unitname,
              wId: detail.wId,
              availableStock: "",
              purchasePrice: 0,
              totalPrice: detail.totalPrice,
              taxRate: 0,
              tax: detail.tax,
              totalMoney: detail.totalMoney,
              discountAmount: 0,
              discountNoRate: 10,
              amount: 0,
            };
          }
        );

        // 计算字段
        this.inquirylist.forEach((row) => {
          // 计算折扣（折扣必须小于10）
          row.discountNoRate = (10 - row.discount / 10).toFixed(2);

          row.amount = (row.totalMoney - row.tax).toFixed(2);

          if (row.amount != 0) {
            row.taxRate = ((row.tax / row.amount) * 100).toFixed(2);
          }

          row.purchasePrice = (
            row.totalPrice /
            (1 + row.taxRate / 100)
          ).toFixed(2);

          row.discountAmount = (
            row.totalNum *
            row.purchasePrice *
            (row.discount / 100)
          ).toFixed(2);
        });
      });
    },
  },
  created() {
    this.selectEm();
    this.selctSH();

    this.purchaseInquiry.id = this.$route.query.id;
    if (this.purchaseInquiry.id) {
      this.selectById();
    }
  },
};
</script>

<style scoped>
#order {
  width: 100%;
  height: 100%;
}

.order-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: calc(100% - 20px);
  padding-left: 20px;
  font-size: 13px;
}

/* .custom-radio .el-radio__label {
  display: none;
} */

.form-group {
  display: flex;
  align-items: center;
  margin-right: 20px; /* 组间距 */
  margin-top: 10px;
}

.el-autocomplete-suggestion__item {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-content {
  width: 100%;
}

.spanRed {
  color: rgb(255, 98, 93);
  margin-right: 8px;
}

.el-input,
.el-button {
  font-size: 13px;
}

.el-select,
.el-date-picker {
  margin-left: 10px;
}

/* 合计行整体样式修改开始 */
.el-table /deep/ .el-table__footer-wrapper tbody td {
  background-color: #fff1d4;
}

.el-table /deep/ .el-table__body tr:hover > td {
  background-color: #fff1d4;
}
</style>